package com.aaa.tars.controller;

import com.aaa.tars.entity.OperateLog;
import com.aaa.tars.service.OperateLogService;
import com.aaa.tars.util.Result;
import com.aaa.tars.util.ResultUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @FileName: OperLogCotroller
 * @Description:
 * @Author: xm
 * @CreateTime: 2025/9/18 11:04
 * @Version: 1.0.0
 */
@RestController
@RequestMapping("operateLog")
public class OperateLogController {
    @Resource
    private OperateLogService operateLogService;

    //添加操作日志
    @PostMapping("add")
    public Result add(@RequestBody OperateLog operateLog) {
        return ResultUtil.success(operateLogService.add(operateLog));
    }

    //查询每月操作日志Echarts图,
    @GetMapping("queryEchartsDataByYearMonth")
    public Result queryEchartsDataByYearMonth(String yearMonth) {
        return ResultUtil.success(operateLogService.queryEchartsDataByYearMonth(yearMonth));
    }
}
